package com.winit.cloudlink.mgmt.heartbeat;

import com.winit.cloudlink.message.Message;
import com.winit.cloudlink.message.annotation.Block;
import com.winit.cloudlink.message.handler.MessageHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * Created by stvli on 2017/3/28.
 */
@Block(false)
@Lazy(false)
@Component
public class HeartbeatMessageHandler implements MessageHandler {
    @Autowired
    private HeartbeatAlerter heartbeatAlerter;

    @Override
    public String getMessageType() {
        return HeartbeatInfo.MESSAGE_TYPE;
    }

    @Override
    public void process(Message message) {
        heartbeatAlerter.onReceive(message);
    }
}
